<!DOCTYPE html>
<html lang="utf-8">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width,user-scalable=no"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>mil rack apm</title>
  <link href="<%=u 'css/bootstrap.min.css' %>" media="screen" rel="stylesheet" type="text/css">
  <script src="<%=u 'js/jquery.min.js' %>"></script>
  <script src="<%=u 'js/js.js' %>"></script>
</head>
<body>
  <header>
    <div class="row">
      <div class="col-xs-offset-1 col-xs-2">
        <h5>MIL RACK APM v0.1.0</h5>
      </div>
    </div>
    <br />
    <div class="row">
      <div class="col-xs-offset-1 col-xs-10">
        <form class="form-inline">
          <div class="form-group">
            <label>METHOD</label>
            <select class="form-control" id="method">
              <option value="">ALL</option>
              <option value="GET">GET</option>
              <option value="POST">POST</option>
              <option value="PUT">PUT</option>
              <option value="DELETE">DELETE</option>
            </select>
          </div>
          <div class="form-group">
            <label>PATH</label>
            <input type="text" class="form-control" id="path"   placeholder="/url">
          </div>
          <div class="form-group">
            <label>MIN COUNT</label>
            <input type="number" class="form-control" id="min_count"  placeholder="0">
          </div>
          <div class="form-group">
            <label>MAX COUNT</label>
            <input type="number" class="form-control" id="max_count" placeholder="0">
          </div>
          <div class="form-group">
            <a href="javascript:void(0)" class="btn btn-danger delete_show"  role="button">Delete Show</a>
          </div>
        </form>
      </div>
    </div>
  </header>
  <br />
  <div class="row">
    <div class="col-md-offset-1 col-md-10 table-responsive">
    <table class="table table-hover" id="table_data">
      <tr class="active no_data" >
        <th>REQUEST METHOD</th><th>PATH</th><th>COUNT</th><th>Mean Time</th><th>Action</th>
      </tr>
      <% @data.each do |data| %>
        <tr class="<%= tr_css data[:request_method] %>" style="">
          <td class="request_method"><%= data[:request_method] %></td>
          <td class="path"><%= data[:path].nil? ? '/' : data[:path] %></td>
          <td class="count"><%= data[:count] %></td>
          <td class="times"><%= '%0.3f' %  (data[:times].to_f  / data[:count].to_f) %>ms</td>
          <td>
            <a href="javascript:void(0)" class="btn btn-danger btn-xs delete_key" key="<%= "#{data[:request_method]}-#{data[:path]}"%>" role="button">Delete</a>
          </td>
        </tr>
      <% end %>
    </table>
    </div>
  </div>

</body>